package structural.flyWeight;

import java.util.Random;
//享元模式
public class Test {
    // 享元模式 要关注线程安全。
    private static final String departments[] = {"RD","QA","PM","BM"};
    public static void main(String[] args) {
        for(int i=0;i<10;i++){
            int a = new Random().nextInt(departments.length);
            String department = departments[a];
            Manager manager = (Manager) EmployeeFactory.getManager(department);
            manager.report();
        }
    }
}
